/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package auditenergetic;
//import com.sun.org.apache.xerces.internal.parsers.SAXParser;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.*;
import org.xml.sax.helpers.*;



public class Date_Beneficiar extends DefaultHandler{


        boolean nume = false;
        boolean prenume = false;
        boolean telefon = false;
        boolean fax = false;
        boolean email = false;
       
       // boolean age = false;
        @Override
       public void startElement(String nsURI, String strippedName,String tagName, Attributes attributes)
        throws SAXException
        {
            if (tagName.equalsIgnoreCase("nume"))
                nume = true;
            if (tagName.equalsIgnoreCase("prenume"))
                prenume = true;
            if(tagName.equalsIgnoreCase("telefon"))
                telefon = true;
            if (tagName.equalsIgnoreCase("fax"))
                fax = true;
            if (tagName.equalsIgnoreCase("email"))
                email = true;

        }@Override
        public void characters(char[] ch,int start, int length)
        {
            if (nume)
            {
                System.out.println("Nume: " + new String(ch,start,length));
                nume = false;
            } else if (prenume)
            {
                System.out.println("Prenume: " + new String(ch,start,length));
                prenume = false;
            } else if (telefon)
            {

                System.out.println("Telefon: "+new String(ch,start,length));
               /* String a = new String(ch,start,length);
                 if (a.equals("caramida"))
                    System.out.println("ana");
                pereti = false;*/
                telefon = false;
            }else if(email)
            {
                 System.out.println("Email: "+new String(ch,start,length));
                 email = false;
            }
        }
    }



